package org.flexspeedup.blog.admin.events
{
import flash.events.Event;

import org.flexspeedup.blog.models.StaticPage;

/**
 * Saves a static page on the datastore
 */
public class SaveStaticPageEvent extends Event
{
    //--------------------------------------------------------------------------
    //
    //  Class Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------
    // ID
    //--------------------------
    /**
     * Unique id for this event.
     */
    public static const ID:String = "SaveStaticPageEvent";
    
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of the <code>SaveStaticPageEvent</code> event 
     */    
    public function SaveStaticPageEvent(page:StaticPage)
    {
        super(ID, true, true);
        _page = page;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  page
    //----------------------------------

    /**
     *  @private
     */
    private var _page:StaticPage;

    /**
     * The static page to be saved
     */
    public function get page():StaticPage
    {
        return _page;
    }

    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - Event
    //
    //--------------------------------------------------------------------------

    /**
     * @inheritdoc flash.events.Event#clone
     */
    override public function clone():Event
    {
        return new SaveStaticPageEvent(page);
    }
}
}